<?php
include_once '../../vendor/autoload.php';

use Union\Pay\Factory;

date_default_timezone_set('PRC');

$config = include_once './Config/Config.php';

$data = [];
// 报文请求时间
$data['requestTimestamp'] = date("YmdHis", time());
// 订单号
$data['merOrderId'] = '33XF'.time() . uniqid();
// 业务类型 机构商户号 MINIDEFAULT|QRPAYDEFAULT|YUEDANDEFAULT
$data['instMid'] = 'MINIDEFAULT';
 // 订单描述 展示在支付截图中
$data['orderDesc'] = '账单描述';
// 支付总金额
$data['totalAmount'] = 2; 
$data['mid'] = "898127210280001";
$data['tid'] = "88880001";

// 使用方法1
Factory::config($config);
$app = Factory::Alipay()->pay();
$reponse = $app->request($data);
echo 'response:' . $reponse . PHP_EOL;


